bitkeeper revision 1.1454 (428b74f28LLau4r-iQuz14PpSU28DA)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 18 May 2005 17:01:38 +0000 (17:01 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 18 May 2005 17:01:38 +0000 (17:01 +0000)
Manual merge.

1  2 
xen/drivers/char/console.c

index de598bc1145291803cfc7cfd7d0a6e1115c71486,f4864f57440b0f87cedc0ef12cbd329afd633a3a..345f33eb88600908711026df9362185d57559dec
@@@ -257,24 -255,21 +257,22 @@@ static void switch_serial_input(void
          printk("*** Serial input -> %s "
                 "(type 'CTRL-%c' three times to switch input to %s).\n",
                 input_str[xen_rx], opt_conswitch[0], input_str[!xen_rx]);
 +    }
  }
  
 -static void __serial_rx(unsigned char c, struct xen_regs *regs)
 +static void __serial_rx(unsigned char c, struct cpu_user_regs *regs)
  {
      if ( xen_rx )
-     {
-         handle_keypress(c, regs);
-     }
-     else if ( (serial_rx_prod-serial_rx_cons) != SERIAL_RX_SIZE )
-     {
-         serial_rx_ring[SERIAL_RX_MASK(serial_rx_prod)] = c;
-         if ( serial_rx_prod++ == serial_rx_cons )
-             send_guest_virq(dom0->exec_domain[0], VIRQ_CONSOLE);
-     }
+         return handle_keypress(c, regs);
+     /* Deliver input to guest buffer, unless it is already full. */
+     if ( (serial_rx_prod-serial_rx_cons) != SERIAL_RX_SIZE )
+         serial_rx_ring[SERIAL_RX_MASK(serial_rx_prod++)] = c;
+     /* Always notify the guest: prevents receive path from getting stuck. */
 -    send_guest_virq(dom0, VIRQ_CONSOLE);
++    send_guest_virq(dom0->exec_domain[0], VIRQ_CONSOLE);
  }
  
 -static void serial_rx(unsigned char c, struct xen_regs *regs)
 +static void serial_rx(unsigned char c, struct cpu_user_regs *regs)
  {
      static int switch_code_count = 0;